package com.zmj.sy.mom.srv.aps.utils;

import cn.hutool.core.date.DatePattern;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.DigestUtils;

import java.nio.charset.StandardCharsets;
import java.time.LocalDate;

@Slf4j
public class ErpUtils {

    private static final String TOKEN_SIGN = "|jgjmes";

    public static String getToken() {
        String formatDate = LocalDate.now().format(DatePattern.NORM_DATE_FORMATTER);
        String md5 = formatDate + TOKEN_SIGN;
        return DigestUtils.md5DigestAsHex(md5.getBytes(StandardCharsets.UTF_8));
    }
}
